#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <QInputDialog>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    QInputDialog* dialog = new QInputDialog(this);
    //int val = dialog->getInt(this,"这是对话框标题","这是一个对话框");
    QStringList list;
    list.push_back("可乐");
    list.push_back("雪碧");
    QString val = dialog->getItem(this,"这是对话框标题","这是一个对话框",list);
    qDebug()<<val;
}
